#include <allegro.h>
#include <stdio.h>

#define NB_IMAGES 3
#define NB_IMAGES_FIGHT 2 // pr pouvoir charger uniquement les images 1 et 2
#define HIGHT 130
#define WIDTH 100

typedef struct
{
int x,y;
int w,h;
int coll; // 0 ou 1 s'il y a coll ou pas
int agg; //aggro (espacement) // 0 ou 1 s'il y a aggro ou pas
int direction; // 0 = right , 1 = left
int is_fighting; //etat de fight
int is_alive; //vie
int HP_MAX;
int HP;
int DPS_MIN;// damage per second
int DPS_MAX;
int HC;

BITMAP *img_l[NB_IMAGES];
//BITMAP *img_l1;
//BITMAP *img_l2;

BITMAP *img_r[NB_IMAGES];
//BITMAP *img_r1;
//BITMAP *img_r2;

} richard;



typedef struct
{
int x,y;
int w,h;
int coll;
int agg; //aggro (espacement)
int direction; // 0 = right , 1 = left 
int is_fighting; //etat de fight
int is_alive; //vie
int HP_MAX;
int HP;
int DPS_MIN;
int DPS_MAX;
int HC;

BITMAP *img_right[NB_IMAGES];
//BITMAP *img_right1;
//BITMAP *img_right2;

BITMAP *img_left[NB_IMAGES];
//BITMAP *img_left1;
//BITMAP *img_left2;

BITMAP *img_face;

} MB;


BITMAP* load_background_bmp(char chemin_background[]);
void draw_background(BITMAP *Background,BITMAP*Buffer);
void destroy_background(BITMAP * Background);

void load_MB(MB *mini);
void load_R(richard *r);

void init_MB(MB *mini);
void init_R(richard *r, int H, int W);

void destroy_R(richard *r);
void destroy_MB(MB *mini);

void move_MB_right(MB *mini,BITMAP * Background );
void move_MB_left(MB *mini,BITMAP * Background );

void mouvement_richard(richard *r, BITMAP *Background,BITMAP *Buffer);
void draw_MB(MB mini,BITMAP *Buffer, int compteur);
void draw_R(richard r,BITMAP *Buffer, int compteur);
/*
int Collision(richard r, MB mini);

void fight(richard *r, MB *mini); 
void main_fight(richard *r, MB *mini);
*/
